


lineList = new File("D:/1.html").readLines()
// 方式二
def func2(){
    lineList.findAll({it.contains(">KQGIS_Desktop")}).each{
        rarName = it.substring(it.lastIndexOf("KQGIS_Desktop"), it.lastIndexOf("</a>"))
        println rarName
    } 

    lineList.findAll({it.contains(">KQGateway")}).each{
        rarName = it.substring(it.lastIndexOf("KQGateway"), it.lastIndexOf("</a>"))
        println rarName
    } 

    lineList.findAll({it.contains(">KQGIS_Server")}).each{
        rarName = it.substring(it.lastIndexOf("KQGIS_Server"), it.lastIndexOf("</a>"))
        println rarName
    }   
}

func2()

// 方式一
def func1(){
    gatewayLst = []
    kqgisDektopLst = []
    kqgisServerLst = []    

    for (line in lineList) {
        if(line.contains(">KQGateway") ){
            rarName = line.substring(line.lastIndexOf("KQGateway"), line.lastIndexOf("</a>"))
            gatewayLst += rarName
            continue
        }
        if(line.contains(">KQGIS_Desktop")){
            rarName = line.substring(line.lastIndexOf("KQGIS_Desktop"), line.lastIndexOf("</a>"))
            kqgisDektopLst += rarName
            continue
        }
        if(line.contains(">KQGIS_Server_")){
            rarName = line.substring(line.lastIndexOf("KQGIS_Server"), line.lastIndexOf("</a>"))
            kqgisServerLst += rarName
            //kqgisServerLst += line
            continue
        }
    } 

    println gatewayLst
    println kqgisDektopLst
    println kqgisServerLst   
}



